package org.example.myframework.frame.demo.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.example.myframework.frame.common.log.annotation.aop.LogAnnotation;
import org.example.myframework.frame.demo.domain.entity.TestTable;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;

@RequestMapping("/aop")
@RestController
@Api(value = "aop接口", tags = {"aop测试接口"})
public class AopController {


    @LogAnnotation(value = "根据id获取对象")
    @GetMapping("/getById")
    @ApiOperation(value = "根据id获取对象")
    public TestTable getById() {
        return new TestTable();
    }

    @LogAnnotation(value = "获取列表")
    @GetMapping("/getTestList")
    @ApiOperation(value = "获取列表")
    public List<TestTable> getList() {
        return new ArrayList<>();
    }

    @ApiOperation(value = "根据id删除")
    @LogAnnotation(value = "根据id删除")
    @DeleteMapping("deleteById")
    public Boolean delete(@RequestParam Long id) {
        return true;
    }

    @ApiOperation(value = "保存")
    @LogAnnotation(value = "保存")
    @GetMapping("save")
    public Boolean save() {
        return true;
    }
}
